<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>object</title>
</head>
<body>
	<script type="text/javascript">
		/*
		var name = '火腿肠';
		function 老虎(){
			alert(name);
		}
		function 企鹅(){
			alert(name);
		}
		老虎();
		*/
		// 对象 (属性和方法)字面量创建  姓名,年龄,性别 ,爱好(动作)
		var  person = {
			name : 'mjj',
			age: 18,
			sex:'女',
			fav: function(a){
				alert('爱好姑娘');
				return '姑娘' + a + '岁';
			}
		}
		console.log(person);
		console.log(person.name);
		console.log(person.fav(18));




	</script>
</body>
</html>